package tutorial.ibatis.example1;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class Test {
	public static void main(String[] args) throws Exception {
		String driverName = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
		// String dbURL =
		// "jdbc:microsoft:sqlserver://10.105.9.6:1433;DatabaseName=Tina";
		String dbURL = "jdbc:sqlserver://192.168.0.69:1433;DatabaseName=hydrang";
		String userName = "hydrang";
		String userPwd = "hydrang";
		Connection dbConn = null;

		Class.forName(driverName);
		dbConn = DriverManager.getConnection(dbURL, userName, userPwd);
		Statement sql = dbConn.createStatement();
		ResultSet res = sql.executeQuery("select * from hydrang.organization_category");
		while (res.next()) {
			System.out.println(res.getString(2));
		}
	}
}
